//先导入一些必须的东西
import {
    PersonnelItem,
    PersonnelFormData,
  } from '@/types';
  import request from '@/utils/request';
  import { AxiosPromise } from 'axios';

/**
 * 获取列表
 *
 * 
 */
 export function listPersDepartmentAll(
  ): AxiosPromise<PersonnelItem[]> {
    return request({
      url: '/persDepartmentAll?action=list',
      method: 'get',
    });
  }

  /**
 * 获取详情
 *
 * @param id
 */
export function getPersDepartmentAllFormDetail(id: number): AxiosPromise<PersonnelFormData> {
  return request({
    url: '/persDepartmentAll?action=detail&id=' + id,
    method: 'get',
  });
}

  /**
 * 添加
 *
 * @param data
 */
export function addPersDepartmentAll(data: PersonnelFormData) {
  console.log(data)
  return request({
    url: '/persDepartmentAll',
    method: 'post',
    data: data,
  });
}

  /**
 * 修改
 *
 * @param id
 * @param data
 */
export function updatePersDepartmentAll(id: number, data: PersonnelFormData) {
  return request({
    url: '/persDepartmentAll',
    method: 'put',
    data: data,
  });
}
  /**
 * 删除
 *
 * @param ids
 */
export function deletePersDepartmentAll(ids: string) {
  return request({
    url: '/persDepartmentAll?id=' + ids,
    method: 'delete',
  });
}
